package com.tongzhan.base;


import com.tongzhan.entity.User;
import com.tongzhan.repository.ActionCenterRepository;
import com.tongzhan.repository.UserRepository;
import com.tongzhan.repository.qiaotai.*;
import com.tongzhan.repository.religion.DutiesRepository;
import com.tongzhan.service.MarkPromptService;
import com.tongzhan.service.SysDictService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.mongodb.core.query.Query;

/**
 * @author hongjianbin
 * @date 2020/7/14
 */
public class BaseShareService {
//    @Autowired
//    public RedisUtils redisUtils;

    @Autowired
    public UserRepository userRepository;
    @Autowired
    public DutiesRepository dutiesRepository;
    @Autowired
    public TPersonnelRepository personnelRepository;
    @Autowired
    public SysDictService sysDictService;
    @Autowired
    public TownInfoRepository townInfoRepository;
    @Autowired
    public OverseasCompanyRepository overseasCompanyRepository;
    @Autowired
    public OverseasHomeRepository overseasHomeRepository;
    @Autowired
    public BasicDemoRepository basicDemoRepository;
    @Autowired
    public OverseasIntroduceRepository overseasIntroduceRepository;
    @Autowired
    public ActionCenterRepository actionCenterRepository;
    @Autowired
    public MarkPromptService markPromptService;
    @Autowired
    public OpinionCarRepository opinionCarRepository;
    @Autowired
    public PolicyRepository policyRepository;

    public User findUserById(String userId) {
//        User user = userRepository.findByPrimaryKey(userId);
        User user = userRepository.findOne(new Query().addCriteria(BaseCriteria.where("UserId").is(userId).and("IsDelete").is(0)));
        return user;
    }
}
